package com.qf.service.impl;

import com.qf.dao.GoodsPackgeMapper;
import com.qf.dao.jpa.GoodPackJpa;
import com.qf.entity.GoodsPackage;
import com.qf.service.GoodPackgeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class GoodPackgeImpl implements GoodPackgeService {

    @Resource
    private GoodPackJpa goodPackJpa;

    @Resource
    private GoodsPackgeMapper goodsPackgeMapper;

    @Override
    public void savaGoodPackge(GoodsPackage goodsPackage) {
        goodPackJpa.save(goodsPackage);
    }

    @Override
    public int getGoodPackgeByGdid(String gpname) {
        int gpid = goodsPackgeMapper.getGoodPackgeByGdid(gpname);
        return gpid;
    }

    @Override
    public void deleGoodPackge(GoodsPackage goodsPackage) {
         goodPackJpa.delete(goodsPackage);
    }
}
